﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace SharedLib.Helpers
{
    public class AppDataHelper
    {
        public static string AppDataFolder
        {
            get 
            {
                string appFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Tracy");
                if(!Directory.Exists(appFolder))
                {
                    Directory.CreateDirectory(appFolder);
                }
                return appFolder;
            }
        }

        public static string GetAppDataFile(string fileName)
        {
            string fullName = Path.Combine(AppDataFolder, fileName);
            string dir = Path.GetDirectoryName(fullName);
            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }
            return fullName;
        }
    }
}
